package com.hundsun.documentripper.domain.dto;

import com.hundsun.documentripper.domain.pojo.File;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

/**
 * Note：
 *
 * @author ：mengjw
 * @description：文件展示对象
 * @date ：Created in 2021/1/28
 */
@Data
@Deprecated
@EqualsAndHashCode(callSuper = true)
public class FileView extends File implements Serializable {

    private static final long serialVersionUID = -2640857661503272493L;
    /**
     * 文件节点预览对象列表
     */
    private List<FileNodeView> fileNodeViews;


    public static FileView formFile(File file) {
        FileView fileView=new FileView();
        fileView.setUuid(file.getUuid());
        fileView.setProductVersionUuid(file.getProductVersionUuid());
        fileView.setDocumentUuid(file.getDocumentUuid());
        fileView.setName(file.getName());
        fileView.setParentUuid(file.getParentUuid());
        fileView.setIsFolder(file.getIsFolder());
        fileView.setCreateUser(file.getCreateUser());
        fileView.setCreateTime(file.getCreateTime());
        fileView.setModifyUser(file.getModifyUser());
        fileView.setModifyTime(file.getModifyTime());
        return fileView;
    }

}